Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 3 - Printer Drivers


Using Resources in Drivers

You need to provide a number of resources for drivers, just as you do for printing extensions. Some of these resources are required for all drivers, others are required for drivers that use a certain imaging system, and others are optional. All of the resources are described in the chapter "Printing Resources" in this book. Table 3-9 summarizes the resources that you can use in all printer drivers.
Table 3-9 Resource types used to define a printer driver
Resource typeCountDescription
'over'1, 2, or 3Defines which messages your driver needs to receive
'isys'1Specifies what kind of imaging system the driver uses
'vers'1 or moreSpecifies which version of QuickDraw GX the driver uses
 
'comm'1 or moreSpecifies printing-device communications parameters
'cust'0 or 1Specifies mappings from the Macintosh Printing Manager to the new driver architecture
'resl'0 or 1Specifies the horizontal and vertical resolution supported by a driver
'PREC'0 or 1Defines a default print record for your driver
'iobm'0 or 1Defines the timeout and buffering communications parameters for your driver
'cpts'0 or 1Specifies how your printing device can be removed and replaced on the network
'look'1Defines the type of communications that is used by the driver
'stat'0 or moreDefines status messages for display
'plrt'0 or moreDefines alert messages for display
'ppnl'0 or moreDefines the contents of a panel that you are adding to a dialog box
'xdtl'0 or moreProvides information that QuickDraw GX needs to execute panel controls
'ptyp'0 or moreDefines characteristics of a paper type
'FREF'1 or moreSpecifies a file reference for the printer driver icons
'PACK'1Specifies Chooser package information
'LDEF'1Specifies Chooser list definition information
'BNDL'1Associates the printer driver with its icons and any files that it uses
'DLOG'0 or moreProvides a dialog box template
'DITL'0 or moreContains an item list for a dialog box
'dctl'0 or moreSpecifies the dialog box control information for compatibility with Macintosh Printing Manager application dialog boxes
'stab'0 or moreDefines a range of scaling for the scaling choice in the Print dialog box that is used for Macintosh Printing Manager compatibility
'ICN#'1 or moreDefines a large (32-by-32 pixel) icon, 1-bit depth, with mask (if not provided, a generic driver icon is used)
'icl4'0 or moreDefines a large icon, 4-bit depth (strongly recommended but not required)
'icl8'0 or moreDefines a large icon, 8-bit depth (strongly recommended but not required)
'ics#'0 or moreDefines a small (16-by-16 pixel) icon, 1-bit depth, with mask (if not provided, a generic driver icon is used)
'ics4'0 or moreDefines a small icon, 4-bit depth (strongly recommended but not required)
'ics8'0 or moreDefines a small icon, 8-bit depth (strongly recommended but not required)

This section provides examples of several of these resources as used in the ImageWriter II printer driver. The contents of the the oldapp.r and newapp.r files, which contain the resource definitions for the ImageWriter II driver, are shown in the QuickDraw GX sample code.

You use some of the resources in Table 3-9 for user interface features, including the icons for your driver, resources that allow users to interact with your driver, and resources that the Chooser uses when the user selects your driver. The Finder interface resources, which are common to all Macintosh drivers, are described in Inside Macintosh: More Macintosh Toolbox. The icons that you must define for your driver when the user chooses it as the desktop printer are described in the section "Defining Desktop Printer Icons for Your Printer Driver" beginning on page 3-66.

All of the resources that you define for your printer drivers need to be loaded into the system heap and need to be purgeable. System resources are stored in the system heap as opposed to the application heap, where application resources are stored. Purgeable resources can be purged by the Memory Manager when space is required, as described in Inside Macintosh: Memory. You need to specify these attributes in the first line of every resource that you define for your driver, as is done in every resource example in this chapter.


Subtopics
Defining Code Segments in Your Driver
Defining Version Compatibility for Your Printer Driver
Specifying Which Messages Your Driver Overrides
Defining the Imaging System Type of Your Driver
Specifying How Your Driver Communicates With the Device
Defining Network Characteristics for Your Driver
Defining Status Messages
Resources for Compatibility With the Macintosh Printing Manager
Defining Device Characteristics Specific to an Imaging System

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help